package com.ljx.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @author 李加喜
 * @date 2020/9/14 0014 15:38
 * @Email 1129071273@qq.com
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class User {
    /**
     * AUTO(0),数据库id自增
 *     NONE(1),来设置主键
 *     INPUT(2),手动输入
 *     ID_WORKER(3),默认的全局唯一性id
 *     UUID(4),全局唯一的id uuid
 *     ID_WORKER_STR(5);  字符串表示法
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    private String name;
    private int age;
    private String email;
    //乐观锁Version注解
    @Version
    private int version;
    //设置逻辑删除的注解
    @TableLogic
    private int isDelete;
    /**
     * 在插入的时候更新和在插入与修改的时候更新
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
}
